How to find Principal Domain and Principal Solution of tan x